GenerativeComponents Help

Animating a Camera

This example modifies the camera eye point's T-value on the curve.

Create a new script transaction and write the following code:

transaction script 'animate camera'
{
	int frames = 15;
	double tVal = 0;
	double tInc = 1/frames; 

	for (int i = 1; i <= frames; i++)
	{ 
		camPt.T = tVal;
		UpdateGraph();
		tVal = tVal + tInc;
	} 
}

The frames variable indicates the number iterated frames. The tVal variable holds the T-parameter value for the camera point (in this case named "camPt") and the tInc variable contains the increment value to step the point along the curve. For this animation you will move the camera along the entire curve, regardless of how many frames are iterated. Instead of calculating the T-value increment manually, a simple equation based on the number of frames will suffice.

Note: Remmber that the UpdateGraph() function will instruct GenerativeComponents to regenerate all open geometry windows at every iteration.